package video

import (
	"app-api/clients/video"
	"context"

	"app-api/app/internal/svc"
	"app-api/app/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type DelVideoDetailLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewDelVideoDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DelVideoDetailLogic {
	return &DelVideoDetailLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *DelVideoDetailLogic) DelVideoDetail(req *types.VideoIDRequest) (resp *types.Empty, err error) {
	_, err = l.svcCtx.VideoRPC.DelVideo(l.ctx, &video.VideoIDRequest{VideoId: req.VideoID})
	if err != nil {
		return nil, err
	}
	return &types.Empty{}, nil
}
